<template>
	<view class="">
		<view class="" style="margin:40rpx auto;width: 500rpx;" >
			<u-image src="/static/gongxi.png" width="500" height="182" mode="widthFix"></u-image>
		</view>
		<view class="mode">
			
			<view class="top u-flex u-row-between">
				<view class="u-flex" style="align-items: center;">
					<u-image src="/static/icon_address.png" width="60" height="60"></u-image>
					<view class="u-margin-left-20" style="width: 500rpx;" v-if="address.id">
						<view>
							<text style="font-size: 32rx;font-weight: bold;">{{address.recipient}}</text>
							<text style="color:#999999;margin-left: 20rpx;">{{address.phone}}</text>
						</view>
						<view class="">
							{{address.address}}
						</view>
					</view>

				</view>
				<!-- <u-icon name="edit-pen" color="#628DFF" size="40" @click="changeAddress" v-if="address.id"></u-icon> -->
			</view>
			
			
			<view class="u-flex " style="padding: 40rpx 40rpx 0 0rpx;" @click="go">
			   <u-image :src="info.goods[0].cover" width="150" height="150"></u-image>	
			   <view class="u-padding-left-20">
				   <view style="font-weight: bold;font-size: 32rpx;">{{info.goods[0].name}}</view>
				   <view style="font-size: 30rpx;color:#FF6450;margin: 20rpx 0;">￥{{info.goods[0].price}}</view>
				   
				   <view style="color: #007AFF;">
					     {{info.status==2?'待发货':''}}
					    {{info.status==3?'待收货':''}}
					    {{info.status==4 && !item.state?'已完成':''}}
					     {{info.state?'售后':''}}
				   </view>
			   </view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
			
				id: "",
				address:"",
	info:""
	
			}
		},
		onLoad(options) {
	
			if (options.id) {
				this.id = options.id
			}
		   this.get()
		},

	
		methods: {
		get(){
			this.$u.post('/api/Indent/bargainDetail', {
				order_id:this.id
			}, {}).then(res => {
			   this.address=res.data;
			   this.info=res.data
			}).catch(err => {})
		
		},
		go(){
			uni.navigateTo({
				url:"/pages/book/detail?id="+this.info.id
			})
		}
		}
	}
</script>

<style>
	page {
	
		width: 100%;
		min-height: 100%;
	
		background: #FB5E3F;
		display: inline-block;
	}
		
	
	.mode  {
		width: 690rpx;
		margin: 40rpx auto;
		border-radius: 40rpx;
		background: #FFFFFF;
		position: relative;
		padding: 40rpx;
	}
	
	
</style>
